Skip to content

Instantly share code, notes, and snippets.

@catlan
catlan / 01its-serverData.json
Last active May 10, 2024 15:03
https://itunes.apple.com/at/app/instagram/id389801252 X-Apple-Store-Front: 143445-2,32 apple-originating-system: MZStore
{
"storePlatformData": {
"product-dv-product": {
"results": {
"389801252": {
"artwork": [
{
"width": 170,
"height": 170,
"url": "https://is2-ssl.mzstatic.com/image/thumb/Purple118/v4/de/b9/5b/deb95b99-0b17-7713-9a0e-99344ebf4e55/Prod-1x_U007emarketing-85-220-0-5.png/170x170bb.png"
@JohnColvin
JohnColvin / gist:3899616
Created October 16, 2012 14:31
Integrate shibboleth into a rails app

How to integrate shibboleth into a rails application

This assumes that shibboleth is installed on the server running the rails application. It should be possible to use SAML to authenticate by shibboleth without installing it on the server.

add to Gemfile

gem 'omniauth-shibboleth' and then bundle

create 'config/initializers/omniauth.rb'

In this example, the user id field is the employee number provided by shibboleth

Rails.application.config.middleware.use OmniAuth::Builder do
@JohnColvin
JohnColvin / gist:5454219
Last active May 10, 2024 15:02
A "pick and choose" method for using fontello icons in rails

Initial installation and rails-ification of fontello assets

Make a fonts asset dir

cd to your rails app and mkdir app/assets/fonts

Choose your icons and download them

  • Browse to fontello.com
  • Choose your fontello icons
  • Click 'Download webfont'
@sanampatel
sanampatel / laravel_migration.txt
Created July 29, 2019 19:45
Commands to run after Laravel git clone or after project migration
#Clone your project from git
composer install
npm install
copy .env.example .env
OR
cp .env.example .env
php artisan key:generate
@stevelacey
stevelacey / survey-completion.js
Last active May 10, 2024 15:02
JS automation of survey completion (with weighting)
function blam(sentiment) {
var sentiment = sentiment || null;
$('input:text, textarea').each(function() {
$(this).val('Generic ' + sentiment + '\'ve input!');
});
$('.question:contains("Email") input:text').val('fake@simpleweb.co.uk');
$('.date-picker').val('October 08, 2014');
{
"auto_complete_commit_on_tab": true,
"color_scheme": "Packages/RailsCasts Colour Scheme/RailsCastsColorScheme.tmTheme",
"detect_slow_plugins": false,
"dictionary": "Packages/Language - English/en_GB.dic",
"draw_minimap_border": true,
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
"._*",
select b.page_uri, x.*, a.body_words as previous_body_words, b.body_words,
(case when a.body_words is null then b.body_words else (b.body_words - a.body_words) end) body_words_diff,
(case when a.article_words is null then b.article_words else (b.article_words - a.article_words) end) article_words_diff,
(case when a.page_or_article_words is null then b.page_or_article_words else (b.page_or_article_words - a.page_or_article_words) end) page_or_article_words_diff,
(case when a.p_words is null then b.p_words else (b.p_words - a.p_words) end) p_words_diff,
(case when a.p_count is null then b.p_count else (b.p_count - a.p_count) end) p_count_diff,
(case when a.img_count is null then b.img_count else (b.img_count - a.img_count) end) img_count_diff
from
(
select
select
max(x.previous_crawl_id) as previous_crawl_id,
x.crawl_id,
max(x.previous_crawl_date) as previous_crawl_date,
x.crawl_date,
sum(a.body_words) as previous_body_words,
sum(b.body_words) as body_words,
(sum(b.body_words) - sum(a.body_words)) as body_words_diff,
sum(a.article_words) as previous_article_words,
sum(b.article_words) as article_words,
select
max(x.previous_crawl_id) as previous_crawl_id,
x.crawl_id,
max(x.previous_crawl_date) as previous_crawl_date,
x.crawl_date,
max(a.body_words_total) as previous_body_words_total,
max(b.body_words_total) as body_words_total,
(max(b.body_words_total) - max(a.body_words_total)) as body_words_diff,
max(a.article_words_total) as previous_article_words_total,
max(b.article_words_total) as article_words_total,
select
x.*,
a.body_words as previous_body_words,
b.body_words as body_words,
(coalesce(b.body_words, 0) - coalesce(a.body_words, 0)) as body_words_diff,
a.article_words as previous_article_words,
b.article_words as article_words,
(coalesce(b.article_words, 0) - coalesce(a.article_words, 0)) as article_words_diff,